<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>   
    <div class="div-info-body">
      <div class="right">
	<a href="/users/add_event?userid=<%$user.id%>">添加生平记事</a>
      </div>	
      <%if $authorized || $user.open eq 'public' %>
      <%if $events|@count gt 0%>
      <!-- <div id="div-event"> -->
      <!-- <h2>生平事迹：</h2> -->
      <table>
        <caption>
	  生平事迹
        </caption>
	<tr>
	  <th class="version">序号</th>
	  <th class="date">日期</th>
	  <th class="event">事件</th>
	  <th class="state">状态</th>
	  <th class="op">操作</th>
	</tr>      
	<% foreach name=events from=$events item=event %>
	<tr>
	  <td><%$event.id%></td>
          <td><%$event.date%></td>
          <td><%$event.event%></td>
          <td><%if $event.state eq $RESOURCE_STATE_DELETED%>已删除<%else%>正常<%/if%></td>
          <td>
            <a href="/users/edit_event?eventid=<%$event.id%>">编辑</a><br/>
            <a href="/users/delete_event?eventid=<%$event.id%>">删除</a><br/>
            <a href="/users/event_history?eventid=<%$event.id%>">历史记录</a>
	  </td>
	</tr>
	<%/foreach%>    
	<tr>
	  <td colspan="8">
	    <%$page%>
	  </td>
	</tr>

      </table>
      <%else%>
      <span class="warnning">
	没有事件！
      </span>
      <%/if%>
      <%else%>
      <span class="warnning">
	没有权限查看！
      </span>
      <%/if%>
      <!-- </div> -->
    </div>
    <div class="clear">
    </div>
  </div>
</div>
<%include file="include/bottom.html"%>

